import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:online_study/base/app_title.dart';
import 'package:online_study/classify/course_item.dart';
import 'package:online_study/course/course_detail.dart';
import 'package:online_study/theme/colors.dart';
import 'package:online_study/theme/size.dart';

//学习记录
class LearningHistoryPage extends StatefulWidget {
  @override
  _LearningHistoryPageState createState() => _LearningHistoryPageState();
}

class _LearningHistoryPageState extends State<LearningHistoryPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: ThemeColor.colorWhite,
      appBar: AppBar(
        leading: BackButton(color: ThemeColor.color333333),
        titleSpacing: 0,
        elevation: ThemeSize.appElevation,
        backgroundColor: ThemeColor.colorWhite,
        title: AppTitle("学习记录"),
      ),
      body: Container(
        padding: EdgeInsets.symmetric(horizontal: ThemeSize.width19),
        child: ListView.separated(
          itemBuilder: (BuildContext context, int index) {
            return GestureDetector(
              child: CourseItemPage(true),
              onTap: () {
                Get.to(() => CourseDetailPage());
              },
            );
          },
          separatorBuilder: (BuildContext context, int index) {
            return Divider(height: ThemeSize.width1);
          },
          shrinkWrap: true,
          itemCount: 8,
        ),
      ),
    );
  }
}
